Failover
JS/TS-friendly facade over com.sorinirmies.arrow.resiliencekit.Failover -- tries a prioritized list of named providers, falling through to the next one when the current one's circuit is open or it fails outright.
The Kotlin failover { provider(...) } DSL builder isn't exposed directly (it's a suspend, receiver-style builder lambda, which doesn't bridge to JS/TS the same way a plain callback does); pass an array of FailoverProviderSpec instead.
import { Failover, FailoverProviderSpec } from "arrow-resilience-kit";
const transport = await Failover.create([
new FailoverProviderSpec("websocket", () => connectWebSocket()),
new FailoverProviderSpec("mqtt", () => connectMqtt()),
]);
const connection = await transport.execute();Functions
Names of all configured providers, in priority order.
Starts actively probing every currently-open provider every intervalMillis, instead of waiting for real traffic to pass through execute and incidentally test them. Call the returned function to stop probing.
Per-provider invocation statistics, in priority order.